/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.net.greenet.policybank.logic;

import cn.net.greenet.common.policy_service.PolicySupport;
import net.sf.json.JSONObject;

/**
 * 获取某类策略类型一个策略仓库所包含的策略数量
 *
 * @author liangdelin
 */
public class GetPolicyNum {

    public String getNum(String type, String instance) {
        //getHeadPoliciesCount(String type, String instance)
        long num = PolicySupport.getInstance().getApi().getHeadPoliciesCount(type, instance);
        JSONObject jo = new JSONObject();
        jo.put("num", num);
        return jo.toString();
    }
}
